﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using Pickle.Core.ExtensionMethods;

namespace Web
{
	public partial class _Default : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			// admin
			int UserPermissions = 1 + 2 + 4 + 8 + 16;

			// CanEdit & CanApprove
			int ModulePermissions = 2 + 8;
			Response.Write(UserPermissions.IsBitUnion(ModulePermissions));

			// contributor
			UserPermissions = 1 + 2 + 4;
			Response.Write(UserPermissions.IsBitUnion(ModulePermissions));
		}

		protected void Process_Command(object sender, CommandEventArgs e)
		{
			ResultLabel.Text = SourceText.Text.Replicate(ReplicateText.Text, int.Parse(ReplicateCount.Text), ReplicationMode.Append);

			Label1.Text = SourceText.Text.PadRight(int.Parse(ReplicateCount.Text), '0');
		}
	}
}
